CONFINEMENT
Overview
The CONFINEMENT function calculates the Confinement number (Co), a dimensionless parameter used in two-phase flow analysis to characterize the relative importance of surface tension forces to buoyancy forces in confined channels. This number is particularly relevant in the analysis of boiling heat transfer and two-phase pressure drop in minichannels and microchannels.
The Confinement number is defined as:
\text{Co} = \frac{\left[\frac{\sigma}{g(\rho_l - \rho_g)}\right]^{0.5}}{D}
where \sigma is the surface tension between liquid and gas phases, g is gravitational acceleration, \rho_l and \rho_g are the liquid and gas densities respectively, and D is the channel diameter.
This implementation uses the fluids library, a comprehensive open-source Python package for fluid dynamics calculations. The Confinement number was first introduced by Cornwell and Kew (1993) to identify flow regime transitions in small channels. When Co > 0.5, surface tension effects dominate over gravitational effects, indicating confined flow behavior where conventional two-phase flow correlations may not apply. For more details, see the fluids.core documentation.
The Confinement number is used extensively in two-phase heat transfer correlations and pressure drop predictions for microscale systems, including refrigeration systems, electronic cooling, and process intensification applications.
This example function is provided as-is without any representation of accuracy.
Excel Usage
=CONFINEMENT(D, rhol, rhog, sigma, g)
D(float, required): Channel diameter (m)rhol(float, required): Density of liquid (kg/m³)rhog(float, required): Density of gas (kg/m³)sigma(float, required): Surface tension (N/m)g(float, optional, default: 9.80665): Acceleration due to gravity (m/s²)
Returns (float): Confinement number (float), or error message string.
Examples
Example 1: Demo case 1
Inputs:
| D | rhol | rhog | sigma | g |
|---|---|---|---|---|
| 0.001 | 1077 | 76.5 | 0.00427 | 9.80665 |
Excel formula:
=CONFINEMENT(0.001, 1077, 76.5, 0.00427, 9.80665)
Expected output:
0.6597
Example 2: Demo case 2
Inputs:
| D | rhol | rhog | sigma | g |
|---|---|---|---|---|
| 0.002 | 900 | 1.2 | 0.03 | 9.80665 |
Excel formula:
=CONFINEMENT(0.002, 900, 1.2, 0.03, 9.80665)
Expected output:
0.9224
Example 3: Demo case 3
Inputs:
| D | rhol | rhog | sigma | g |
|---|---|---|---|---|
| 0.0005 | 1000 | 0.6 | 0.072 | 9.80665 |
Excel formula:
=CONFINEMENT(0.0005, 1000, 0.6, 0.072, 9.80665)
Expected output:
5.4208
Example 4: Demo case 4
Inputs:
| D | rhol | rhog | sigma | g |
|---|---|---|---|---|
| 0.01 | 800 | 1 | 0.002 | 9.80665 |
Excel formula:
=CONFINEMENT(0.01, 800, 1, 0.002, 9.80665)
Expected output:
0.0505
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.core import Confinement as fluids_confinement
def confinement(D, rhol, rhog, sigma, g=9.80665):
"""
Calculate the Confinement number (Co) for two-phase flow in a channel.
See: https://fluids.readthedocs.io/fluids.core.html
This example function is provided as-is without any representation of accuracy.
Args:
D (float): Channel diameter (m)
rhol (float): Density of liquid (kg/m³)
rhog (float): Density of gas (kg/m³)
sigma (float): Surface tension (N/m)
g (float, optional): Acceleration due to gravity (m/s²) Default is 9.80665.
Returns:
float: Confinement number (float), or error message string.
"""
try:
D = float(D)
except (ValueError, TypeError):
return "Error: D must be a numeric value."
try:
rhol = float(rhol)
except (ValueError, TypeError):
return "Error: rhol must be a numeric value."
try:
rhog = float(rhog)
except (ValueError, TypeError):
return "Error: rhog must be a numeric value."
try:
sigma = float(sigma)
except (ValueError, TypeError):
return "Error: sigma must be a numeric value."
try:
g = float(g)
except (ValueError, TypeError):
return "Error: g must be a numeric value."
if D <= 0:
return "Error: D must be positive."
if rhol <= 0:
return "Error: rhol must be positive."
if rhog < 0:
return "Error: rhog must be non-negative."
if sigma <= 0:
return "Error: sigma must be positive."
if g <= 0:
return "Error: g must be positive."
if rhol <= rhog:
return "Error: rhol must be greater than rhog."
try:
result = fluids_confinement(D, rhol, rhog, sigma, g)
except Exception as e:
return f"Error: Failed to calculate Confinement number: {str(e)}"
return result